<template>
	<view class="bg-white" style="min-height: 100vh;"
		:style="{background:'url('+Imgbase+'/1zhan_new_sbgc2.jpg)','background-size':'100%',}">

		<!-- <view class="w100 h-950 card_bgc "
			:style="{background:'url('+Imgbase+'/kp_gr_bgc2.png)','background-size':'100% 100%',}">

		</view> -->

		<view class="zinde">
			<view class="" style="padding: 100rpx 40rpx 0;">
				<image @click="back" class="w-60 h-90 margin-right-20" :src="Imgbase + '/kp_setting_back.png'"
					mode="aspectFit"></image>
				<image class="w-110 h-80" :src="Imgbase + '/kp_card_title.png'" mode="aspectFit"></image>
			</view>
			
			<view class="df alc left_scr fff padding-top-8 padding-bottom-8 radius-12 padding-left-15" style="width: 95%;margin: 5rpx auto 25rpx;">
				<image class="w-50 h-50 margin-right-10" :src="Imgbase + '/1zhan_new_laba.png'" mode="aspectFit"></image>
				<u-parse :content="explain1"></u-parse>
			</view>

			<!-- 标题 -->
			<view class="w-530 h-80 auto margin-top-30 text-center font-weight-500 black-color font-28"
				style="line-height: 80rpx;"
				:style="{background:'url('+Imgbase+'/kp_card_img1.png)','background-size':'100% 100%',}">
				{{desc.name}}
			</view>
		</view>

		<!--  -->
		<view class=" flex-between zinde margin-top-50">
			<view class="padding-top-80">
				<image class="w-140 h-100" :src="Imgbase + '/kp_card_img3.png'" mode="aspectFit"></image>
			</view>
			<view class=" h-400 flex-center">
				<image @click="viewAdimage()" class="w-350 h-340" :src="desc.adimage" mode="aspectFit"></image>
			</view>
			<view class="padding-bottom-50">
				<view class="padding-left-30">
					<image class="w-140 h-100 margin-bottom-25" :src="Imgbase + '/kp_card_img4.png'" mode="aspectFit">
					</image>
				</view>
				<!-- <view class="margin-bottom-70 margin-top-70" v-if="liked == 0">
					<image @click="savePoor(did)" class="w-140 h-100" :src="Imgbase + '/kp_card_img5.png'"
						mode="aspectFit"></image>
				</view>
				<view class="margin-bottom-70 margin-top-70" v-if="liked == 1">
					<image @click="unsavePoor(did)" class="w-140 h-100" :src="Imgbase + '/kp_card_img5_c.png'"
						mode="aspectFit"></image>
				</view> -->
				<view class="">
					<button
						style="display: flex;justify-content: center;overflow: hidden;background-color:transparent;margin-top: 15upx;"
						open-type="share">
						<view>
							<image class="w-140 h-100" :src="Imgbase + '/kp_card_img6.png'" mode="aspectFit"></image>
						</view>
					</button>
				</view>
			</view>
		</view>

		<!-- 黑色框 -->
		<!-- <view class="w-720 h-160 auto zinde padding-30"
			:style="{background:'url('+Imgbase+'/kp_card_kuang.png)','background-size':'100% 100%',}">
			<view class="flex-between fff font-30 font-weight-500 padding-left-30 padding-right-30">
				<view class="">
					{{desc.cost}}{{costMap[desc.type]}} /次
				</view>
				<view class="">
					剩余： <text style="color: #FEC74B;" class="font-45 margin-right-5">{{desc.count}}</text>
					/{{desc.number}}
				</view>
			</view>
			<view class="padding-30">
				<view v-for="(item,index) in desc.reword_text" :key="index">
					<view class='text_item'
						v-if="item.reword_type_name == 'First'||item.reword_type_name == 'Last'||item.reword_type_name == '全局'||item.reword_type_name == '冲冲'">
						{{item.reword_type_name}}:{{item.nownumber}}/{{item.allnumber}}
					</view>
					<view class='text_item'
						v-if="item.reword_type_name != 'First'&&item.reword_type_name != 'Last'&&item.reword_type_name != '全局'&&item.reword_type_name != '冲冲'&&item.nownumber!=0">
						{{item.reword_type_name}}:{{Number(item.nownumber/desc.count*100).toFixed(1)}}%
					</view>
					<view class='text_item'
						v-if="item.reword_type_name != 'First'&&item.reword_type_name != 'Last'&&item.reword_type_name != '全局'&&item.reword_type_name != '冲冲'&&item.nownumber==0">
						{{item.reword_type_name}}:0.00%
					</view>
				</view>
			</view>
		</view> -->

		<!-- tab切换 -->
		<view class="w100 flex-between padding-20">
			<view class="">
				<image @click="tab_btn()" class="w-350 h-120" :src=" Imgbase+'/kp_gr_tab1' + [tab==1?'_c':''] + '.png'"
					mode="aspectFit"></image>
			</view>
			<view class="">
				<image @click="tab_btn()" class="w-350 h-120" :src=" Imgbase+'/kp_in_ntab2' + [tab==2?'_c':''] + '.png'"
					mode="aspectFit"></image>
			</view>
		</view>

		<!-- 奖品列表 -->
		<view class="padding-20" style="overflow: hidden;" v-if="tab == 1">
			<view class="cu-item fl text-sm padding-8 radius-10 list_item fff" style="width: 30%;margin-bottom: 10upx;
			margin-top: 0rpx;position: relative;height: 358upx;background-color: #353941;"
				v-for="(item,index) in desc.msg_list">
				<view class="image" @click="lookImages(item.adimage,item.name)">
					<view class="bg-black"
						style="position: absolute;width: 97%;height: 58%;z-index: 20;display: flex;justify-content: center;align-items: center;"
						v-if="item.nownumber == 0">
						<image :src="Imgbase + '/1zhan_selled.png'" mode="aspectFit"
							style="width: 170upx;height: 170upx;">
						</image>
					</view>
					<image :src="item.adimage" mode="aspectFit" style="height: 200rpx;"></image>
					<view class="cu-bar " style="
					display: block;line-height: 40upx;opacity: 0.9;height: 170upx;padding: 8upx;">
						<image v-if="item.reword_type_name == 'First'" class="fl" :src="Imgbase + '/first2.png'"
							style="width: 120upx;height: 40upx;z-index: 80;position: relative;margin-left: 0upx;margin-top: 5upx;">
						</image>
						<image v-if="item.reword_type_name == 'Last'" class="fl" :src="Imgbase + '/last2.png'"
							style="width: 110upx;height: 40upx;z-index: 80;position: relative;margin-left: 0upx;margin-top: 5upx;">
						</image>
						<image v-if="item.reword_type_name == '全局'" class="fl" :src="Imgbase + '/quanju2.png'"
							style="width: 96upx;height: 50upx;z-index: 80;position: relative;margin-left: 0upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == '冲冲'" class="fl" :src="Imgbase + '/chognchong5.png'"
							style="width: 96upx;height: 50upx;z-index: 80;position: relative;margin-left: 0upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'A'" class="fl" :src="Imgbase + '/a2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'B'" class="fl" :src="Imgbase + '/b2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'C'" class="fl" :src="Imgbase + '/c2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'D'" class="fl" :src="Imgbase + '/d2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'E'" class="fl" :src="Imgbase + '/e2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'F'" class="fl" :src="Imgbase + '/f2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'G'" class="fl" :src="Imgbase + '/g2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'H'" class="fl" :src="Imgbase + '/h2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'I'" class="fl" :src="Imgbase + '/i2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'J'" class="fl" :src="Imgbase + '/j2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'K'" class="fl" :src="Imgbase + '/k2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'L'" class="fl" :src="Imgbase + '/l2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'M'" class="fl" :src="Imgbase + '/m2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'N'" class="fl" :src="Imgbase + '/n2.png'"
							style="width: 56upx;height: 40upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'SP'" class="fl" src="/static/fonticon/sp.png"
							style="width: 60upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'O'" class="fl" src="/static/fonticon/o.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'P'" class="fl" src="/static/fonticon/p.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'Q'" class="fl" src="/static/fonticon/q.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'R'" class="fl" src="/static/fonticon/r.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'S'" class="fl" src="/static/fonticon/s.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'T'" class="fl" src="/static/fonticon/t.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'U'" class="fl" src="/static/fonticon/u.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'V'" class="fl" src="/static/fonticon/v.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'W'" class="fl" src="/static/fonticon/w.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'X'" class="fl" src="/static/fonticon/x.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'Y'" class="fl" src="/static/fonticon/y.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_name == 'Z'" class="fl" src="/static/fonticon/z.png"
							style="width: 32upx;height: 35upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<view style="clear: both;"></view>
						<view class="w100 one-line fff" style="">
							{{item.name}}
						</view>
						<view class="">
							数量:{{item.num}}
						</view>
					</view>
				</view>
			</view>
		</view>

		<!-- 记录 -->
		<view class=" record" v-if="tab == 2">
			<!-- 全局赏 -->
			<view class="solid-bottom light" v-for="(item,index) in desc.awards_list" :key="index"
				style="width: 94%;margin-left: 3%;">
				<view class="action fl text-sm  text-ablack"
					style="text-align: center;width: 110rpx;padding-left: 12rpx;">
				</view>
				<view class="text-sm padding-sm text-grey fl" style="padding-top: 30rpx;">
					<view class="content text-ablack text-df"
						style="max-width: 260upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
						<text class="text_color2 text-bold"
							style="max-width: 260upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{item.nickname}}</text>
					</view>
					<view class="action text-df text_color2 text-bold"
						style="max-width: 330upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
						{{item.goods_name}}
					</view>
				</view>
				<view class="text-sm padding text-grey fr" style="padding-left: 0rpx;">
					<view class="content fl text_color2 text-df">
						<!--<image v-if="item.reword_type_id == 1" class="fl" src="/static/fonticon/first.png"
					 style="width: 140upx;height: 70upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;"></image>
					<image v-if="item.reword_type_id == 2" class="fl" src="/static/fonticon/last.png"
					 style="width: 140upx;height: 70upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;"></image>-->
						<!--<image v-if="item.reword_type_id == 3" class="fl" src="/static/fonticon/quanju.png"
					  style="width: 80upx;height: 30upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 10upx;"></image>
					  :src="Imgbase + '/app_index_c_top2.png'"-->
						<image v-if="item.reword_type_id == 1" class="fl" :src="Imgbase + '/first2.png'"
							style="width: 200upx;height: 68upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 2" class="fl" :src="Imgbase + '/last2.png'"
							style="width: 172upx;height: 64upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 3" class="fl" :src="Imgbase + '/quanju2.png'"
							style="width: 140upx;height: 70upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 33" class="fl" :src="Imgbase + '/chognchong5.png'"
							style="width: 140upx;height: 70upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 34" class="fl" :src="Imgbase + '/box6.png'"
							style="width: 140upx;height: 70upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 43" class="fl" :src="Imgbase + '/1zhan_sff.png'"
							style="width: 120upx;height: 50upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 42" class="fl" :src="Imgbase + '/1zhan_soo.png'"
							style="width: 120upx;height: 50upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<!--<view class="fl margin-top-sm" v-if="item.reword_type_id == 3">赏</view>-->
						<!--<view class="fl margin-top" v-if="item.reword_type_id != 3">赏</view>-->
					</view>
				</view>
				<view style="clear: both;"></view>
			</view>

			<!-- 祈愿赏 -->
			<view class="solid-bottom light" v-for="(item,index) in praylist" :key="index"
				style="width: 94%;margin-left: 3%;">
				<view class="action fl text-sm padding text-ablack">
				</view>
				<view class="text-sm padding-sm text-grey fl" style="padding-top: 30rpx;">
					<view class="content text-ablack text-df"
						style="max-width: 260upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
						<text class="text_color2 text-bold"
							style="max-width: 260upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{item.usermes.nickname}}</text>
					</view>
					<view class="action text-df text_color2 text-bold"
						style="max-width: 350upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
						{{item.goodmes.name}}
					</view>
					<view class="action text-df text_color2 text-bold"
						style="max-width: 350upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
						{{item.goodmes.name}}
					</view>
				</view>
				<view class="text-sm padding text-grey fr" style="padding-left: 0rpx;">
					<view class="content fl text_color2 text-df">
						<image class="fl" :src="Imgbase + '/1new_lucki_shang.png'" mode="widthFix"
							style="width: 140upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
					</view>
				</view>
				<view style="clear: both;"></view>
			</view>


			<view class="solid-bottom light" v-for="(item,index) in jilulogs" :key="index"
				style="width: 94%;margin-left: 3%;">
				<view class="action fl text-sm padding text-ablack">
				</view>
				<view class="text-sm padding-sm text-grey fl" style="padding-top: 30rpx;">
					<view class="content text-ablack text-df"
						style="max-width: 300upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
						<text class="text_color1">{{item.usermes.nickname}}</text>
					</view>
					<view class="action text-df text_color1"
						style="max-width: 350upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
						{{item.goodmes.name}}
					</view>
				</view>
				<view class="text-sm padding text-grey fr">
					<view class="content fl text-gray text-df">
						<image v-if="item.reword_type_id == 4" class="fl" :src="Imgbase + '/a3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 5" class="fl" :src="Imgbase + '/b3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 6" class="fl" :src="Imgbase + '/c3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 7" class="fl" :src="Imgbase + '/d3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 8" class="fl" :src="Imgbase + '/e3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 9" class="fl" :src="Imgbase + '/f3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 10" class="fl" :src="Imgbase + '/g3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 11" class="fl" :src="Imgbase + '/h3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 12" class="fl" :src="Imgbase + '/i3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 13" class="fl" :src="Imgbase + '/j3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 14" class="fl" :src="Imgbase + '/k3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 15" class="fl" :src="Imgbase + '/l3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 16" class="fl" :src="Imgbase + '/m3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 17" class="fl" :src="Imgbase + '/n3.png'"
							style="width: 92upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 30" class="fl" src="/static/fonticon/sp.png"
							style="width: 110upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 18" class="fl" src="/static/fonticon/o.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 19" class="fl" src="/static/fonticon/p.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 20" class="fl" src="/static/fonticon/q.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 21" class="fl" src="/static/fonticon/r.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 22" class="fl" src="/static/fonticon/s.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 23" class="fl" src="/static/fonticon/t.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 24" class="fl" src="/static/fonticon/u.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 25" class="fl" src="/static/fonticon/v.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 26" class="fl" src="/static/fonticon/w.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 27" class="fl" src="/static/fonticon/x.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 28" class="fl" src="/static/fonticon/y.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
						<image v-if="item.reword_type_id == 29" class="fl" src="/static/fonticon/z.png"
							style="width: 55upx;height: 65upx;z-index: 80;position: relative;margin-left: 4upx;margin-top: 0upx;">
						</image>
					</view>
				</view>
				<view style="clear: both;"></view>
			</view>

			<!-- <view class="padding" style="width: 100%;height: 40upx;margin-bottom: 80rpx;">
				<view class="action fl">
					<text class="cuIcon-back fl" style="font-size: 34rpx;color: #000000;"
						@click="jilupageleft()">上一页</text>
				</view>
				<view class="action fr">
					<text style="font-size: 34rpx;color: #000;" @click="jilupageright()"><text>下一页<text
								class="cuIcon-right"></text></text></text>
				</view>
			</view> -->
		</view>

		<view class="h-170">

		</view>


		<!-- 购买按钮 -->
		<view class="padding-20 flex-between btns w100 " v-if="timeend == 0">
			<!-- 单抽 -->
			<view class=" " style="width: 250rpx;margin: 0 auto;" @click="buybutton(0)">
				<image :src="Imgbase + '/1zhan_app_buy_1.png'" v-if="desc.is_join ==0"
					style="width: 220upx;height: 150upx;" mode="aspectFit"></image>
				<image :src="Imgbase + '/1zhan_app_buy_1un.png'" v-else style="width: 220upx;height: 150upx;"
					mode="aspectFit"></image>
			</view>
		</view>


		<!-- 恭喜获得 -->
		<view class="cu-modal" :class="modalName2=='buyModal'?'show':''" @tap="hideModal2" @tap.stop="">
			<view class="cu-dialog" style="background-color:initial;margin-top: 100rpx;width: 90%;height: 75%;"
				:style="{background:'url('+Imgbase+'/new1_infinite_boxtanchuangbgc.png) no-repeat','background-size':'100% 100%'}">
				<view class="" style="width: 100%;height: 100%;" v-if="getspecial == false">

					<scroll-view class="scroll text-left" scroll-y="true" style="padding: 300rpx 50rpx 0;height: 50%;">
						<view class="box_tanchuang"
							style="width: 180rpx; height: 170rpx;float: left ;margin-bottom: 20rpx;border-radius: 12rpx;position: relative;"
							v-for="(item,index) in buylist" :key="index">
							<view class="" style="padding: 10rpx;height: 180rpx;" :style="{background:item.reword_type_name == 'SSR'?'url('+Imgbase+'/new1_infinite_SSR1.png) no-repeat':
								item.reword_type_name == 'SR'?'url('+Imgbase+'/new1_infinite_SR1.png) no-repeat':
								item.reword_type_name == 'SP'?'url('+Imgbase+'/new1_infinite_SD1.png) no-repeat':
								item.reword_type_name == 'R'?'url('+Imgbase+'/new1_infinite_R1.png) no-repeat':
								item.reword_type_name == 'N'?'url('+Imgbase+'/new1_infinite_N1.png) no-repeat':
								item.reword_type_name == 'M'?'url('+Imgbase+'/new1_infinite_M1.png) no-repeat':
								item.reword_type_name == 'SSS'?'url('+Imgbase+'/new1_infinite_SSS1.png) no-repeat':''
								,'background-size':'100% 100%',}">
								<!-- 动图 -->
								<view class="animation" v-if="item.reword_type_name == 'SSS'">
								</view>

								<image style="width: 100%; height: 100%;" :src="item.adimage" mode="widthFix"></image>
								<view class="fonts"
									style="position: absolute; bottom: 15rpx;right: 15rpx;color: #F78852;font-weight: bold;font-size: 30rpx;">
									x{{item.num}}

								</view>
								<view class=""
									style="position: absolute; top: 10rpx;right: 10rpx;width: 100rpx; height: 50rpx;">
									<image style="width: 100%;" v-if="item.reword_type_name == 'SSS'"
										:src="Imgbase + '/new1_infinite_SSS_new.png'" mode="widthFix"></image>
									<image style="width: 100%;" v-if="item.reword_type_name == 'SSR'"
										:src="Imgbase + '/new1_infinite_SSR.png'" mode="widthFix"></image>
								</view>
							</view>
						</view>
					</scroll-view>
					<!-- 祈愿奖励 -->
					<view class="" style="padding: 0 50rpx;height: 30%;">
						<view class="" v-if="pray != ''"
							style="font-size: 30rpx;font-weight: bold;text-align: left;padding-bottom: 20rpx;">
							祈愿:
						</view>
						<view class="box_tanchuang" v-if="pray != ''"
							style="width: 180rpx; height: 170rpx;float: left ;margin-bottom: 20rpx;border-radius: 12rpx;position: relative;">
							<view class="" style="padding: 10rpx;height: 180rpx;" :style="{background:pray.reword_type_name == 'SSR'?'url('+Imgbase+'/new1_infinite_SSR1.png) no-repeat':
								pray.reword_type_name == 'SR'?'url('+Imgbase+'/new1_infinite_SR1.png) no-repeat':
								pray.reword_type_name == 'SP'?'url('+Imgbase+'/new1_infinite_SD1.png) no-repeat':
								pray.reword_type_name == 'R'?'url('+Imgbase+'/new1_infinite_R1.png) no-repeat':
								pray.reword_type_name == 'N'?'url('+Imgbase+'/new1_infinite_N1.png) no-repeat':
								pray.reword_type_name == 'M'?'url('+Imgbase+'/new1_infinite_M1.png) no-repeat':
								pray.reword_type_name == 'SSS'?'url('+Imgbase+'/new1_infinite_SSS1.png) no-repeat':''
								,'background-size':'100% 100%',}">

								<!-- 动图 -->
								<view class="animation" v-if="pray.reword_type_name == 'SSS'">
								</view>
								<image style="width: 100%; height: 100%;" :src="pray.adimage" mode="widthFix"></image>
								<view class=""
									style="position: absolute; top: 10rpx;right: 10rpx;width: 100rpx; height: 50rpx;">
									<image style="width: 100%;" v-if="pray.reword_type_name == 'SSS'"
										:src="Imgbase + '/new1_infinite_SSS_new.png'" mode="widthFix"></image>
									<image style="width: 100%;" v-if="pray.reword_type_name == 'SSR'"
										:src="Imgbase + '/new1_infinite_SSR.png'" mode="widthFix"></image>
								</view>
							</view>
						</view>
					</view>
					<view class="" style="text-align: center;">
						<image @click="showbuy_off" style="width: 300rpx;" :src="Imgbase + '/new1_infinite_goonbtn.png'"
							mode="widthFix"></image>
					</view>
				</view>

				<view class="" style="width: 100%;height: 100%;" v-if="getspecial">
					<scroll-view class="scroll text-left" scroll-y="true" style="padding: 300rpx 50rpx 0;height: 42%;">
						<view class="box_tanchuang"
							style="width: 30%;float: left ;margin-bottom: 20rpx;border-radius: 12rpx;position: relative;"
							v-for="(item,index) in buylist" :key="index">
							<view class="" style="padding: 10rpx;height: 180rpx;overflow: hidden;">
								<!-- 动图 -->
								<view class="animation" v-if="item.reword_type_name == 'SSS'">
								</view>
								<view class=""
									style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;z-index: 0;"
									:style="{background:item.reword_type_name == 'SSR'?'url('+Imgbase+'/new1_infinite_SSR1.png) no-repeat':
								item.reword_type_name == 'SR'?'url('+Imgbase+'/new1_infinite_SR1.png) no-repeat':
								item.reword_type_name == 'SP'?'url('+Imgbase+'/new1_infinite_SD1.png) no-repeat':
								item.reword_type_name == 'R'?'url('+Imgbase+'/new1_infinite_R1.png) no-repeat':
								item.reword_type_name == 'N'?'url('+Imgbase+'/new1_infinite_N1.png) no-repeat':
								item.reword_type_name == 'M'?'url('+Imgbase+'/new1_infinite_M1.png) no-repeat':
								item.reword_type_name == 'SSS'?'url('+Imgbase+'/new1_infinite_SSS1.png) no-repeat':''
								,'background-size':'100% 100%',}">

									<image style="width: 100%; height: 100%;" :src="item.adimage" mode="widthFix">
									</image>
									<view class="fonts"
										style="position: absolute; bottom: 15rpx;right: 15rpx;color: #F78852;font-weight: bold;font-size: 30rpx;">
										x{{item.num}}
									</view>
									<view class=""
										style="position: absolute; top: 10rpx;right: 10rpx;width: 100rpx; height: 50rpx;">
										<image style="width: 100%;" v-if="item.reword_type_name == 'SSS'"
											:src="Imgbase + '/new1_infinite_SSS_new.png'" mode="widthFix"></image>
										<image style="width: 100%;" v-if="item.reword_type_name == 'SSR'"
											:src="Imgbase + '/new1_infinite_SSR.png'" mode="widthFix"></image>
									</view>
								</view>
							</view>
						</view>
					</scroll-view>

					<!-- 祈愿奖励 -->
					<view class="" style="padding: 0 50rpx;height: 21%;">
						<view class="" v-if="pray != ''"
							style="font-size: 30rpx;font-weight: bold;text-align: left;padding-bottom: 20rpx;">
							祈愿:
						</view>
						<view class="box_tanchuang" v-if="pray != ''"
							style="width: 180rpx; height: 170rpx;float: left ;margin-bottom: 20rpx;border-radius: 12rpx;position: relative;">
							<view class="" style="padding: 10rpx;height: 180rpx;" :style="{background:pray.reword_type_name == 'SSR'?'url('+Imgbase+'/new1_infinite_SSR1.png) no-repeat':
								pray.reword_type_name == 'SR'?'url('+Imgbase+'/new1_infinite_SR1.png) no-repeat':
								pray.reword_type_name == 'SP'?'url('+Imgbase+'/new1_infinite_SD1.png) no-repeat':
								pray.reword_type_name == 'R'?'url('+Imgbase+'/new1_infinite_R1.png) no-repeat':
								pray.reword_type_name == 'N'?'url('+Imgbase+'/new1_infinite_N1.png) no-repeat':
								pray.reword_type_name == 'M'?'url('+Imgbase+'/new1_infinite_M1.png) no-repeat':
								pray.reword_type_name == 'SSS'?'url('+Imgbase+'/new1_infinite_SSS1.png) no-repeat':''
								,'background-size':'100% 100%',}">

								<!-- 动图 -->
								<view class="animation" v-if="pray.reword_type_name == 'SSS'">
								</view>
								<image style="width: 100%; height: 100%;" :src="pray.adimage" mode="widthFix"></image>
								<view class=""
									style="position: absolute; top: 10rpx;right: 10rpx;width: 100rpx; height: 50rpx;">
									<image style="width: 100%;" v-if="pray.reword_type_name == 'SSS'"
										:src="Imgbase + '/new1_infinite_SSS_new.png'" mode="widthFix"></image>
									<image style="width: 100%;" v-if="pray.reword_type_name == 'SSR'"
										:src="Imgbase + '/new1_infinite_SSR.png'" mode="widthFix"></image>
								</view>
							</view>
						</view>
					</view>

					<view class=""
						style="text-align: left; padding: 10rpx 0 0 40rpx;color: #59100B;font-size: 28rpx;font-weight: bold;">
						额外获得隐藏
					</view>
					<scroll-view class="scroll text-left" scroll-y="true" style="padding: 10rpx 50rpx 0;height: 20%;">
						<view class="box_tanchuang"
							style="width: 30%; height: 30%; float: left ;margin-bottom: 20rpx;border-radius: 12rpx;position: relative;"
							v-for="item in buylist2">
							<view class="" style="height: 180rpx;border: 6rpx solid #F78852;border-radius: 10rpx;"
								:style="{background:item.reword_type_name == 'SSR'?'url('+Imgbase+'/new1_infinite_SSR1.png) no-repeat':
								item.reword_type_name == 'SR'?'url('+Imgbase+'/new1_infinite_SR1.png) no-repeat':
								item.reword_type_name == 'SP'?'url('+Imgbase+'/new1_infinite_SD1.png) no-repeat':
								item.reword_type_name == 'R'?'url('+Imgbase+'/new1_infinite_R1.png) no-repeat':
								item.reword_type_name == 'N'?'url('+Imgbase+'/new1_infinite_N1.png) no-repeat':
								item.reword_type_name == 'M'?'url('+Imgbase+'/new1_infinite_M1.png) no-repeat':
								item.reword_type_name == 'SSS'?'url('+Imgbase+'/new1_infinite_SSS1.png) no-repeat':''
								,'background-size':'100% 100%',}">

								<image style="width: 100%; height: 100%;" :src="item.adimage" mode="widthFix"></image>
								<view class="fonts"
									style="position: absolute;right: 15rpx;color: #F78852;font-weight: bold;top: 200%;font-size: 30rpx;">
									x{{item.num}}
								</view>
								<view class=""
									style="position: absolute; top: 10rpx;right: 10rpx;width: 100rpx; height: 50rpx;">
									<image style="width: 100%;" v-if="item.reword_type_name == 'SSS'"
										:src="Imgbase + '/new1_infinite_SSS_new.png'" mode="widthFix"></image>
									<image style="width: 100%;" v-if="item.reword_type_name == 'SSR'"
										:src="Imgbase + '/new1_infinite_SSR.png'" mode="widthFix"></image>
								</view>
							</view>
						</view>
					</scroll-view>

					<view class="" style="">
						<image @click="showbuy_off" style="width: 300rpx;margin-top: 30rpx;"
							:src="Imgbase + '/new1_infinite_goonbtn.png'" mode="widthFix"></image>

					</view>
				</view>

			</view>
		</view>
		<view class="cu-modal" :class="modalName=='photomodel'?'show':''" @tap="hideModal">
			<view class="cu-dialog" style="width: 90%;height: 800rpx;background-color: #fff;" @tap.stop="">
				<view class="" style="width: 100%;position: relative;">
					<image :src="photoimg" mode="widthFix" style="width: 100%;height: 100%;"></image>
					<view class="" @click="modalName = null"
						style="position: absolute;width: 50rpx;height: 50rpx;top: 20rpx;right: 25rpx;z-index: 999;">
						<image :src="Imgbase + '/new1_infinite_close.png'" mode="widthFix"
							style="width: 100%;height: 100%;"></image>
					</view>
				</view>

				<view class="" style="margin-top: 40rpx;text-align: center;font-weight: bold;">
					{{looktitle}}
				</view>
			</view>
		</view>

		<view class="cu-modal bottom-modal" :class="modalName=='bottomModal'?'show':''">
			<view style="width: 100%;height: 1200upx;position: absolute;top: 0%;" @tap="hideModal"></view>
			<view class="cu-dialog" style="background-color: #fafaec;">
				<view class="padding">
					<view class="fl" style="width: 100rpx;border-radius: 15rpx;overflow: hidden;">
						<image @click="viewAdimage()" :src="desc.adimage" mode="widthFix"></image>
					</view>
					<view class="fl text-left" style="padding-left: 30rpx;">
						<view class="text-lg" style="color: #e66142;">
							￥{{buymoney}}
						</view>
						<view class="text-sm" style="color: #635120;">
							单价({{desc.cost}}/次)
						</view>
						<view class="text-sm" style="color: #635120;">
							购买次数{{buycount}}次
						</view>
					</view>
				</view>
				<view style="clear: both;"></view>
				<view v-if="coupon > 0 && desc.type != '2'" class="padding-sm"
					style="background-color: #f0f0e5;height: 80upx;margin-left: 3%;width: 94%;border-radius: 20upx;margin-bottom: 20rpx;margin-top: 10rpx;">
					<view class="fl">剩余{{Math.floor(coupon * 1000) / 100}}GOOD豆 (可抵值{{ Math.floor(coupon * 100) / 100}})</view>
					<view class="fr text-lg" style="color: #e66142;">
						<u-switch v-model="checked" active-color="#19BE6B" @change="radioChange"></u-switch>
					</view>
				</view>
				<view style="width: 100%;height: 15upx;"></view>
				<view style="clear: both;"></view>
				<view class="padding-sm"
					style="background-color: #f0f0e5;margin-left: 3%;width: 94%;border-radius: 20upx;">
					<view class="flex-between">
						<view class="">需支付</view>
						<view class=" text-lg" style="color: #e66142;">￥{{buymoneys}}</view>
					</view>
					<view class="flex-between padding-top-15">
						<view class="">剩余余额</view>
						<view class=" text-lg" style="color: #e66142;">￥{{money}}</view>
					</view>
				</view>
				<view class="cu-bar">
					<view class="action flex-sub text-green " style="min-height: 100rpx;" @tap="submitLuck()">
						<image :src="Imgbase + '/gooddetail_alarm_b3.png'" mode="widthFix" style="width: 550rpx;">
						</image>
					</view>
				</view>
				<view style="clear: both;"></view>
				<view style="width: 100%;height: 60upx;"></view>
			</view>
		</view>


		<view class="refresh">
			<image @click="startR" :style="{'transform': 'rotate('+360*refreshtime+'deg)','transition': 'all 1s'}"
				class="w-90 h-90" :src="Imgbase + '/new_goodresh.png'" mode="aspectFit"></image>
		</view>

	</view>
</template>

<script>
	import md5 from '@/utils/md5.js'
	export default {
		data() {
			return {
				Imgbase: getApp().globalData.Imgbase,
				id: 0,
				desc: [],
				tab: 1,
				jilulogs: [],
				costMap: ['', '', '积分'],
				refreshtime: 0,
				openbuy: false,
				previous: 0,
				buyradio: 1,
				modalName: '',
				buymoney: 0,
				buymoneys: 0,
				buycount: 0,
				coupon: 0,
				coupon_s: 0,
				checked: true,
				did: 0,
				modalName2: null,
				liked: 0,
				money: 0,
				getspecial: false,
				timeend: 0,
				photoimg: '',
				looktitle: '',
				explain1:''
			}
		},
		onShareAppMessage(res) {
			let _this = this;
			return {
				title: _this.desc.name,
				path: '/pagesA/advanced/poordetail?id=' + _this.did,
				imageUrl: _this.desc.adimage,
			}
		},
		onLoad(e) {
			this.id = e.id
			this.did = e.id;
			this.timeend = e.time
			console.log()
			// this.loadDesc(e.id)
		},
		onShow() {
			this.poordesc()
			this.poorlist()
			this.poorLogList(1, 1)
			this.getuser()
			this.showbue()
			// this.isSave()
		},
		methods: {
			showbue() {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Index/explain',
					data: {
						id: 19
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						_this.explain1 = res.data.data.desc.content;
					}
				});
			},
			viewAdimage() {
				let adimage = [];
				adimage = adimage.concat(this.desc.adimage);
				this.photoimg = adimage
				this.modalName = 'photomodel';
				this.looktitle = this.desc.name
				// uni.previewImage({
				// 	urls: adimage,
				// 	current: 0
				// });
			},
			lookImages(url, title) {
				this.photoimg = url
				this.looktitle = title
				this.modalName = 'photomodel';
			},
			loadReword(id) {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Luckgoods/rewordlog',
					data: {
						id: id,
						// index:0,
						index: uni.getStorageSync(id + 'ren') || 0,
						hiddenindex: uni.getStorageSync(id + 'hiddenlen') || 0,
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
						}
						if (res.data.code == '1') {
							// 祈愿列表 praylist
							_this.praylist = res.data.data.praylist


							var tmplog = [];
							if (uni.getStorageSync(id + 'r') != '') {
								tmplog = JSON.parse(uni.getStorageSync(id + 'r'));
							}
							for (let i = 0; i < res.data.data.loglist.length; i++) {
								tmplog = tmplog.concat(res.data.data.loglist[i])
							}
							uni.setStorageSync(id + 'r', JSON.stringify(tmplog));
							uni.setStorageSync(id + 'ren', tmplog.length);
							_this.rewordlist = tmplog.reverse()
							//_this.rewordlist = res.data.data.loglist;
							//_this.hiddenlist = res.data.data.hiddenlist;
							tmplog = [];
							if (uni.getStorageSync(id + 'hiddenl') != '') {
								tmplog = JSON.parse(uni.getStorageSync(id + 'hiddenl'));
							}
							for (let i = 0; i < res.data.data.hiddenlist.length; i++) {
								tmplog = tmplog.concat(res.data.data.hiddenlist[i])
							}
							uni.setStorageSync(id + 'hiddenl', JSON.stringify(tmplog));
							uni.setStorageSync(id + 'hiddenlen', tmplog.length);
							// let zhegnlist = tmplog.reverse()
							// console.log('3123',tmplog)
							_this.hiddenlist = tmplog.reverse()
							_this.hiddenlogscount = Math.ceil(_this.hiddenlist.length / 100);
							_this.hiddenlogs = [];
							for (let i = 0; i < _this.hiddenlogscount; i++) {
								_this.hiddenlogs[i] = [];
								for (let j = 0; j < 100; j++) {
									if (_this.hiddenlist[i * 100 + j] != null) {
										_this.hiddenlogs[i] = _this.hiddenlogs[i].concat(_this.hiddenlist[i *
											100 + j])
									}
								}
							}
							// console.log(_this.hiddenlogs[_this.hiddenlogsindex].length)
							// _this.hiddenlogs = _this.hiddenlogs.reverse()
							// _this.hiddenlogsindex = 0;
						}
						if (res.data.code == '0') {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
					}
				});
			},
			loadDesc(id) {
				let _this = this;
				_this.page = 1;
				_this.hasData = true;
				_this.loadModal = true;
				_this.loadReword(id);
				uni.request({
					url: _this.$globals.apibase + '/api/delay/poorDesc',
					data: {
						token: uni.getStorageSync('token'),
						poor_id: id,
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
							_this.login();
						}
						if (res.data.code == '1') {
							_this.desc = res.data.data.info
							if (_this.desc != null) {
								_this.desc.info_text = [];
							}
							let numss = res.data.data.loglist
							_this.desc = res.data.data.desc;
							_this.title = _this.desc.name;
							_this.liked = res.data.data.liked;
							_this.lockstate = res.data.data.lockstate;
							_this.pray_open = res.data.data.desc.othertype;
							_this.locktime = res.data.data.locktime;
							_this.locknickname = res.data.data.locknickname;
							_this.box_limit_num = res.data.data.desc.box_limit_num;
							clearTimeout(_this.timer);
							//clearTimeout(_this.timerwechat);
							if (_this.lockstate == '1') {
								_this.showLockTime();
							}
							_this.loglist = [];
							_this.hasData = true;
							// for (let i = 0; i < res.data.data.loglist.length; i++) {
							// 	_this.loglist = _this.loglist.concat(res.data.data.loglist[i])
							// }
							if (res.data.data.loglist.length < _this.count) {
								_this.hasData = false
							}


							var tmplog = [];
							if (uni.getStorageSync(id + 'l') != '') {
								tmplog = JSON.parse(uni.getStorageSync(id + 'l'));
							}
							for (let i = 0; i < res.data.data.loglist.length; i++) {
								tmplog = tmplog.concat(res.data.data.loglist[i])
							}
							uni.setStorageSync(id + 'l', JSON.stringify(tmplog));
							uni.setStorageSync(id + 'len', tmplog.length);
							_this.loglist = tmplog.reverse()
							_this.lastlogcount = Math.ceil(_this.loglist.length / 100);
							_this.lastlogs = [];
							for (let i = 0; i < _this.lastlogcount; i++) {
								_this.lastlogs[i] = [];
								for (let j = 0; j < 100; j++) {
									if (_this.loglist[i * 100 + j] != null) {
										_this.lastlogs[i] = _this.lastlogs[i].concat(_this.loglist[i * 100 +
											j])
									}
								}
							}
							// _this.lastlogindex = 0;
						}
						if (res.data.code == '0') {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}

						setTimeout(() => {
							_this.loadModal = false;
						}, 300)
					}
				});
			},
			showbuy_off() {
				this.modalName2 = null
				this.poorLogList(1, 1)

			},
			submitLuck() {
				let _this = this;
				_this.modalName = null;
				// if (_this.desc.othertype != '0') {
				// 	if (_this.times != 0) {
				// 		uni.showToast({
				// 			icon: 'error',
				// 			title: '该奖池为单抽奖池',
				// 			duration: 5000
				// 		});
				// 		return;
				// 	}
				// }
				if (_this.openbuy == true) {
					return;
				}
				_this.openbuy = true;
				_this.loadLuck = true;
				if (_this.desc.type == 2) {
					_this.buyradio = 0
				}
				// const date = (new Date().getTime() / 1000).toFixed(0);
				// var str = date + 'akd!k123#dfg' + _this.desc.id

				// 加密
				let str = _this.$uniApi.mdnum();
				console.log(str)
				var md5Str = md5.hex_md5(str[1])

				uni.request({
					url: _this.$globals.apibase + '/api/Luckorder/createOrder',
					data: {
						token: uni.getStorageSync('token'),
						good_poor_id: _this.desc.id,
						times: _this.times,
						ver: _this.$mpVer,
						use_coupon: _this.buyradio,
						nonce: str[2],
						sign: md5Str,
						timestamp: str[0]
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						_this.loadLuck = false;
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
						}
						if (res.data.code == '1') {
							if (res.data.data.state == 1) {
								/*uni.showToast({
									icon: 'success',
									title: '抽取成功',
									duration: 5000,
								});*/
								if (_this.desc.type == 1) {
									uni.request({
										url: _this.$globals.apibase + '/api/User/doRank',
										data: {
											token: uni.getStorageSync('token'),
											price: _this.buycount * _this.desc.cost,
										},
										method: 'POST',
										header: {
											'content-type': 'application/json'
										},
										success: (res) => {},
									});
								}
								_this.getuser();
								_this.loadDesc(_this.desc.id);
								_this.modalName = null;
								_this.openbuy = false;
								_this.getspecial = res.data.data.getspecial
								//带着抽取记录去奖励界面
								_this.modalName2 = 'buyModal';
								let ssss = res.data.data.log_reword
								let dddd = res.data.data.special_rewords
								_this.buylist = JSON.parse(ssss)
								_this.buylist2 = JSON.parse(dddd)
								// console.log(_this.buylist2)
								// uni.navigateTo({
								// 	url: `/pages/goodspoor/reword?logid=` + res.data.data.logs
								// });
							} else if (res.data.data.state == 0) {
								uni.requestPayment({
									timeStamp: res.data.data.result.timeStamp,
									nonceStr: res.data.data.result.nonceStr,
									package: res.data.data.result.package,
									signType: res.data.data.result.signType,
									paySign: res.data.data.result.paySign,
									success: function(result) {
										uni.showToast({
											icon: 'success',
											title: '支付成功',
											duration: 5000,
										});
										_this.getuser();
										//_this.loadDesc(_this.desc.id);
										_this.modalName = null;
										_this.openbuy = false;
										_this.loadModal = true;
										if (_this.desc.type == 2) {
											_this.buyradio = 0
										}
										let str = _this.$uniApi.mdnum();
										var md5Str = md5.hex_md5(str[1])
										uni.request({
											url: _this.$globals.apibase +
												'/api/Luckorder/createOrder',
											data: {
												token: uni.getStorageSync('token'),
												good_poor_id: _this.desc.id,
												times: _this.times,
												ver: _this.$mpVer,
												use_coupon: _this.buyradio,
												nonce: str[2],
												sign: md5Str,
												timestamp: str[0]
											},
											method: 'POST',
											header: {
												'content-type': 'application/json'
											},
											success: (res) => {
												_this.loadLuck = false;
												if (res.data.code == '401') {
													uni.setStorageSync('token', '');
												}
												if (res.data.code == '1') {
													if (res.data.data.state == 1) {
														/*uni.showToast({
															icon: 'success',
															title: '抽取成功',
															duration: 5000,
														});*/
														if (_this.desc.type == 1) {
															uni.request({
																url: _this
																	.$globals
																	.apibase +
																	'/api/User/doRank',
																data: {
																	token: uni
																		.getStorageSync(
																			'token'
																		),
																	price: _this
																		.buycount *
																		_this
																		.desc
																		.cost,
																},
																method: 'POST',
																header: {
																	'content-type': 'application/json'
																},
																success: (
																	res
																) => {},
															});
														}
														_this.getuser();
														_this.loadDesc(_this.desc.id);
														_this.modalName = null;
														_this.openbuy = false;
														_this.getspecial = res.data
															.data.getspecial
														//带着抽取记录去奖励界面
														//let ssss = res.data.data.logs
														/*_this.buylist = JSON.parse(
															ssss)*/
														_this.modalName2 = 'buyModal';
														let ssss = res.data.data
															.log_reword
														let dddd = res.data.data
															.special_rewords
														_this.buylist = JSON.parse(
															ssss)
														_this.buylist2 = JSON.parse(
															dddd)
														// console.log(res.data.data.logs)
														// uni.navigateTo({
														// 	url: `/pages/goodspoor/reword?logid=` +
														// 		res.data.data
														// 		.logs
														// });

													}
												} else {
													if (res.data.msg == '') {
														res.data.msg = '服务器繁忙,购买失败';
													}
													uni.showToast({
														icon: 'none',
														title: res.data.msg
													});
													_this.openbuy = false;
												}
											},
										});
									},
									fail: (res) => {
										_this.openbuy = false;
									},
									cancel: (res) => {
										_this.openbuy = false;
									},
								})
							} else {
								if (res.data.msg == '') {
									res.data.msg = '服务器繁忙,购买失败';
								}
								uni.showToast({
									icon: 'none',
									title: res.data.msg
								});
								_this.openbuy = false;
							}
						}
						if (res.data.code == '0') {
							if (res.data.msg == '') {
								res.data.msg = '服务器繁忙,购买失败';
							}
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
							_this.openbuy = false;
							_this.loadDesc(_this.did);
						}
						console.log(_this.buylist)
					},
					fail: (res) => {
						_this.openbuy = false;
					},
					cancel: (res) => {
						_this.openbuy = false;
					},
				});
			},
			isSave() {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Luckorder/isSave',
					data: {
						token: uni.getStorageSync('token'),
						id: this.id
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.data.count == 0) {
							_this.liked = 0;
						} else {
							_this.liked = 1;
						}
					}
				});
			},
			// 获取个人信息
			getuser() {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Userways/userFront',
					data: {
						token: uni.getStorageSync('token'),
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '1') {
							_this.id = res.data.data.user_desc.id;
							_this.money = res.data.data.user_desc.money;
							_this.score = res.data.data.user_desc.score;
							_this.pray_number = res.data.data.user_desc.pray_number;
							_this.coupon = res.data.data.user_desc.coupon;
						}
					}
				});
			},
			hideModal(e) {
				this.modalName = null
				this.buyradio = 1
				this.checked = true
				this.poorLogList(1, 1)
			},
			hideModal2(e) {
				this.modalNamebuy = null
				this.modalName2 = false
				this.poorLogList(1, 1)
			},
			radioChange(e) {
				console.log(this.checked)
				console.log(this.buyradio)
				let sss = this.buymoney.split('欧')[0];
				this.buymoneys = sss - this.coupon
				if (this.buyradio == 1) {
					this.buyradio = 0
					this.buymoneys = this.buymoney
				} else {
					let sss = this.buymoney.split('欧')[0];
					let a = sss - this.coupon
					if (a > 0) {
						this.buymoneys = a
					} else {
						this.buymoneys = 0
					}
					this.buyradio = 1
				}
			},
			async buybutton() {
				let item = await this.$api.post('delay/poorJoin', {
					token: uni.getStorageSync('token'),
					poor_id: this.did
				})
				if (item.code == 1) {
					uni.showToast({
						icon: 'none',
						title: '抽奖成功',
					});
				}
				this.poordesc()
			},
			// buybutton(times) {
			// 	console.log(11111)
			// 	let now = parseInt(new Date().getTime()) + '';
			// 	let wait = 1000;
			// 	if (now - this.previous > wait) {
			// 		this.previous = now;
			// 		this.doLuck(times)
			// 	} else {
			// 		// uni.showToast({
			// 		// 	icon: 'none',
			// 		// 	title: '请勿频繁操作',
			// 		// });
			// 	}
			// },
			doLuck(times) {
				console.log(22222)
				this.checked = true
				this.buyradio = 1
				let _this = this;
				if (_this.loadLuck == true || _this.openbuy == true) {
					return;
				}
				_this.times = times;
				if (_this.times == 0) {
					_this.buycount = 1;
				}
				if (_this.times == 1) {
					_this.buycount = 3;
				}
				if (_this.times == 2) {
					_this.buycount = 10;
				}
				if (_this.desc.count < _this.buycount) {
					uni.showToast({
						icon: 'none',
						title: '奖池剩余抽数不足' + _this.buycount + '发',
						duration: 5000
					});
					return;
				}
				_this.buymoney = parseFloat(_this.buycount * _this.desc.cost).toFixed(2);
				let coupon = parseFloat(_this.coupon)
				if (coupon < _this.buymoney) {
					_this.coupon_s = _this.coupon
				} else {
					_this.coupon_s = _this.buymoney
				}
				let numss = parseFloat(_this.buycount * _this.desc.cost).toFixed(2) - _this.coupon
				if (numss > 0) {
					_this.buymoneys = numss;
				} else {
					_this.buymoneys = 0;
				}
				// _this.buymoneys = parseFloat(_this.buycount * _this.desc.cost).toFixed(2);
				if (_this.desc.type == 2) {
					let mes = '';
					if (_this.score >= _this.buymoney) {} else {
						mes += '积分不足，无法购买';
					}
					_this.buymes = mes;
					_this.buymoney += '积分';
				} else {
					let mes = '';
					if (parseFloat(_this.money) >= parseFloat(_this.buymoney)) {} else {
						mes += '不足，';
						let needpay = parseFloat(_this.buymoney - _this.money).toFixed(2);
						mes += '需支付' + needpay + '';
					}
					_this.buymes = mes;
				}
				//_this.modalName = 'paymodel';
				_this.modalName = 'bottomModal';
			},
			// 刷新
			startR() {
				if (getApp().globalData.couldFresh == true) {
					getApp().globalData.couldFresh = false;
					setTimeout(() => {
						getApp().globalData.couldFresh = true;
					}, 1000)
				} else {
					/*uni.showToast({
						icon: 'none',
						title: '刷新频率点击太快啦'
					});*/
					return;
				}
				this.refreshtime += 1;
				this.openbuy = false;
				//this.getuser();
				this.loadDesc(this.did);
				this.poorLogList(1, 1)
			},
			// 有底池 -- 记录
			poorLogList(page, one) {
				let _this = this
				_this.loadModal = true;
				uni.request({
					url: _this.$globals.apibase + '/api/Luckgoods/poorLogList',
					data: {
						token: uni.getStorageSync('token'),
						poor_id: _this.did,
						index: page,
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
						}
						if (res.data.code == '1') {
							if (res.data.data.list == '' && one !== 1) {
								_this.ssrnum = _this.ssrmaxnum
								uni.showToast({
									icon: 'none',
									title: '已经是最后一页了',
								});
							} else {
								_this.jilulogs = res.data.data.list
							}

						}
						if (res.data.code == '0') {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
						setTimeout(() => {
							_this.loadModal = false;
						}, 300)
					}
				});
			},
			savePoor(id) {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Luckorder/savePoor',
					data: {
						token: uni.getStorageSync('token'),
						goods_poor_id: id,
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
						}
						if (res.data.code == '1') {
							uni.showToast({
								icon: 'success',
								title: '添加收藏成功'
							});
							_this.liked = 1;
						}
						if (res.data.code == '0') {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
					}
				});
			},
			unsavePoor(id) {
				let _this = this;
				uni.request({
					data: {
						token: uni.getStorageSync('token'),
						goods_poor_id: id,
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
						}
						if (res.data.code == '1') {
							uni.showToast({
								icon: 'success',
								title: '取消收藏成功'
							});
							_this.liked = 0;
						}
						if (res.data.code == '0') {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
					}
				});
			},
			back() {
				var _this = this;
				uni.navigateBack({
					delta: 1,
					success: function() {
					},
					fail:function() {
						uni.navigateTo({
							url:'/pagesA/advanced/free'
						})
					},
				});
			},
			// tab切换
			tab_btn() {
				if (this.tab == 1) {
					this.tab = 2
				} else {
					this.tab = 1
				}
			},
			// 获取奖池
			async poordesc() {
				let _this = this
				let item = await this.$api.post('delay/poorDesc', {
					token: uni.getStorageSync('token'),
					poor_id: _this.did,
				})
				this.desc = item.data.info
			},
			// 抽奖
			async createOrde(e) {
				let _this = this
				let item = await this.$api.post('infinite/createOrder', {
					token: uni.getStorageSync('token'),
					good_poor_id: _this.id,
					ver: _this.$mpVer,
					times: e
				})
				this.desc = item.data.desc
			},
			async poorlist() {
				let _this = this
				let item = await this.$api.post('Luckgoods/poorlist', {
					token: uni.getStorageSync('token'),
					id: 0,
					orderid: 1,
					keyword: '',
					page: 1
				})
			},
		},
	}
</script>

<style lang="less" scoped>
	.left_scr {
		background-color: rgba(0, 0, 0, .3);
	}
	.text_color1 {
		color: #2ffcff;
	}

	.text_color2 {
		color: #f1ff85;
	}

	.cu-dialog {
		// background-image: linear-gradient(#8acee7, #ADE3E4);
	}

	.text_item {
		float: left;
		margin-right: 20rpx;
		height: 30rpx;
		line-height: 30rpx;
		color: #c7c7c7;
	}

	.text_item:nth-last-child(0) {
		margin-right: 0;
	}

	.record {
		background-image: linear-gradient(#618699, #56A3A1);
		min-height: 100rpx;
		width: 95%;
		margin: 0 auto;
		border-radius: 20rpx;
		border: 4rpx solid #e3e3e3;
	}

	.list_item {
		float: left;
		margin-bottom: 20rpx;
		margin-right: 25rpx;
	}

	.list_item:nth-child(3n) {
		margin-right: 0;
	}

	.refresh {
		position: fixed;
		right: 40rpx;
		bottom: 250rpx;
		z-index: 999;
	}

	.btns {
		position: fixed;
		bottom: 10rpx;
		z-index: 999;
	}

	.jitem {
		display: inline-block;
		margin-right: 60rpx;
	}


	.zinde {
		position: relative;
		z-index: 10;
	}

	.card_bgc {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 0;
	}

	.auto {
		margin: 0 auto;
	}

	button:after {
		border: none;
	}
</style>